﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="gallery.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.gallery" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p style="font-size: x-large; font-weight: bolder; text-decoration: underline;">BMW - X6 Gallery </p>
    <br />
    Here is where you will find the most amazing design of cars which have been 
    snapshot and uploaded by our users. Have a look and comment on your thoughts and 
    ideas once your registered with us. If your already registered with us then 
    simply click <a href ="Account/Login.aspx">here</a> to get 
    commenting away.&nbsp;
    <br />
    <br />
    Why not get involved and upload a picture of your BMW - X6 to get commented on 
    as it may convince you to add extra few bits onto your precious ride to get it 
    kitted out and gain some popularity by our users.&nbsp;&nbsp;<br />
    <br />
    Click on any image to see what comments other users have posted, why not get 
    involed? It&#39;s a free service. <br />
    <br />
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
        GroupItemCount="3">
        <AlternatingItemTemplate>
            <td runat="server" style="">
                
                <strong><a href="imageComments.aspx?id=<%# Eval("ImageID") %>">***Image***</a></strong>
                
                <a href="imageComments.aspx?id=<%# Eval("ImageID") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>

                
                <br /></a>
                <strong>Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Eval("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                <br />
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td runat="server" style="">
                
                ***Image***
                                <a href="imageComments.aspx?id=<%# Eval("ImageID") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                <br />
                Description:
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                Date Uploaded:
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                Time Uploaded:
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                Uploaded by:
                <asp:TextBox ID="UserNameTextBox" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" style="">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
            <td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td runat="server" style="">
                                <strong><a href="imageComments.aspx?id=<%# Eval("ImageID") %>">***Image***</a></strong>

                    <a href="imageComments.aspx?id=<%# Eval("ImageID") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                <br />
                Description:
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                Date Uploaded:
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                Time Uploaded:
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                Uploaded by:
                <asp:TextBox ID="UserNameTextBox" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td runat="server" style="">
               
                               <strong><a href="imageComments.aspx?id=<%# Eval("ImageID") %>">***Image***</a></strong>

                                <a href="imageComments.aspx?id=<%# Eval("ImageID") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                <br />
                <strong>Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Eval("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded: </strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded: </strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Uploaded By: </strong>
                <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                <br />
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" border="0" style="">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" style="">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" style="">
                               
                <strong>***Image***</strong>
                                                <a href="imageComments.aspx?id=<%# Eval("ImageID") %>"><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>

                <br />
                <strong>Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Eval("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                <br />
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        
        SelectCommand="SELECT Images.ImageID, Images.ImageLink, Images.ImageDescription, Images.DateUploaded, Images.TimeUploaded, aspnet_Users.UserName FROM (Images INNER JOIN aspnet_Users ON Images.UserIDFK = aspnet_Users.UserId) ORDER BY Images.ImageID DESC">
    </asp:SqlDataSource>
</asp:Content>
